Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <p>Can my browser play MP4 videos? <span> <button onclick="supportType(event,'video/mp4','avc1.42E01E, mp4a.40.2')" type="button">Test</button> </span></p> <p>Can my browser play OGG videos? <span> <button onclick="supportType(event,'video/ogg','theora, vorbis')" type="button">Test</button> </span></p> <p><strong>Note:</strong> The canPlayType() method is not supported in Internet Explorer 8 and earlier versions.</p> <script> function supportType(e,vidType,codType) { var vid = document.createElement('video'); isSupp = vid.canPlayType(vidType+';codecs="'+codType+'"'); if (isSupp == "") { isSupp = "No"; } e.target.parentNode.innerHTML = "Answer: " + isSupp; } </script> </body> <!-- Mirrored from www.w3schools.com/tags/tryit.asp?filename=tryhtml5_av_met_canplaytype by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:09:48 GMT --> </html>
Result:
Try it Yourself - © w3schools.com